package edu.pku.sei.pgie.persistence.xml;

import java.io.File;

import edu.pku.sei.pgie.analyzer.core.Context;
import edu.pku.sei.pgie.analyzer.core.ICollector;
import edu.pku.sei.pgie.analyzer.internal.Metrics;
import edu.pku.sei.pgie.beans.CodeEntity;
import edu.pku.sei.pgie.beans.Link;
import edu.pku.sei.pgie.beans.Structure;
import edu.pku.sei.pgie.persistence.PersistenceException;

public class XmlCollector implements ICollector {
    Context context;
    public XmlCollector(Context context) throws PersistenceException {
        this.context = context;
        if(context.getOutputDir() == null || context.getOutputDir().length() == 0)
            throw new PersistenceException("invalid output dir");
        if(!new File(context.getOutputDir()).exists()) {
            throw new PersistenceException("invalid output dir");
        }
    }

    public void collect(Structure structure) {
    }

    public void collect(Link link) {
    }

    public void collect(CodeEntity codeEntity) {
    }

    public void close() {
    }

    public void collect(Metrics metrics) {
        throw new RuntimeException();
    }

    public long nextCodeId() {
        throw new RuntimeException();
    }

    /* (non-Javadoc)
     * @see edu.pku.sei.pgie.analyzer.core.ICollector#nextStructureId()
     */
    public long nextStructureId() {
        // TODO Auto-generated method stub
        return 0;
    }

}
